/*
package com.migu.controller;

import SysProject;
import com.migu.service.SysProjectService;
import GlobalConst;
import Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

*/
/**
 * @Description TODO :
 * @Author: zj
 * @Date: 15:19 2019/4/18
 * @Version 1.0
 **//*

@RestController
@RequestMapping("/api/v1/project")
public class SysProjectController {


    @Autowired
    private SysProjectService projectService;

    //获取所有项目
    @GetMapping("/getList")
    public Response getList() {
        Response result = null;
        try {
            result=Response.success(projectService.findAll());
        } catch (Exception e) {
            result = Response.error(GlobalConst.Code.FAIL_500, e.getMessage());
        }
        return result;
    }

    //添加项目
    @PostMapping("/addProject")
    public Response addProject(@RequestBody SysProject sysProject) {
        Response result = null;
        try {
            if (projectService.addProject(sysProject)) {
                result= Response.success();
            } else {
                result = Response.error(GlobalConst.Code.ERROR_400, "添加失败！");
            }
        } catch (Exception e) {
            result = Response.error(GlobalConst.Code.FAIL_500, e.getMessage());
        }
        return result;
    }

    //删除项目
    @DeleteMapping("/deleteProject/{id}")
    public Response deleteProject(@PathVariable String id) {
        Response result = null;
        try {
            if (projectService.deleteProjectById(id)) {
                result= Response.success();
            } else {
                result = Response.error(GlobalConst.Code.ERROR_400, "删除失败！");
            }
        } catch (Exception e) {
            result = Response.error(GlobalConst.Code.FAIL_500, e.getMessage());
        }
        return result;
    }

    //修改项目
    @PutMapping("/updateProject")
    public Response updateProject(@RequestBody SysProject sysProject) {
        Response result = null;
        try {
            if (projectService.updateProject(sysProject)) {
                result= Response.success();
            } else {
                result = Response.error(GlobalConst.Code.ERROR_400, "修改失败！");
            }
        } catch (Exception e) {
            result = Response.error(GlobalConst.Code.FAIL_500, e.getMessage());
        }
        return result;
    }
}
*/
